home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5172 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: po.CWRU.Edu!mab22
  2. From: mab22@po.CWRU.Edu (Michael A. Balfour)
  3. Newsgroups: comp.lang.c
  4. Subject: Data Conversions
  5. Date: 8 Feb 1996 00:23:53 GMT
  6. Organization: Case Western Reserve University, Cleveland, OH (USA)
  7. Message-ID: <4fbfqp$fsk@madeline.INS.CWRU.Edu>
  8. Reply-To: mab22@po.CWRU.Edu (Michael A. Balfour)
  9. NNTP-Posting-Host: kanga.ins.cwru.edu
  10.  
  11.  
  12. (in case I haven't asked enough questions yet)
  13.  
  14. Are there any pre-existing routines to do data conversions?  Before you
  15. start bringing up printf and atol, let me explain a little further.  I'm
  16. looking for routines that can just as easily push an 8-byte Big-Endian
  17. number into an EBCDIC string as transforming an ASCII string to a COMP-3
  18. (COBOL datatype), or possibly any of the above to a VARCHAR to get
  19. loaded into Oracle.
  20.  
  21. I've tried writing a routine with the following API:
  22. void Translate(long dataType,long length,char *inData,
  23.                long outDataType, long outLength,char *outData);
  24.  
  25. Unfortunately, it's either suffered speed drawbacks or become very
  26. complicated in terms of adding data types.  (One function is needed for
  27. every type of datatype conversion)
  28.  
  29. Surely, somebody has run into this problem before and solved it?
  30.  
  31. For all the COBOL mainframe programs out there, *somebody* must have
  32. written C programs to deal with them and created a nice set of
  33. public-domain translation routines, right?
  34.  
  35. Please e-mail a reply along with posting, if possible.
  36.  
  37. Thanks,
  38.  
  39. Mike Balfour
  40. -- 
  41. ----------------------------------+--------------------------------
  42. Mike Balfour, Partner             | BS/MS Candidate - ECMP
  43. Overload Engineering              | Case Western Reserve University
  44. "New Ideas for a Brighter Future" | Cleveland, OH
  45.